package com.red.star.wechat.data.mappers;

import com.red.star.wechat.data.core.base.MyMapper;
import com.red.star.wechat.data.entity.SettleDetail;
import com.red.star.wechat.data.entity.vo.SettleDetailVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author nofish.yan@gmail.com
 * @date 2018/6/28.
 * 结算明细数据访问接口
 */
public interface SettleDetailMapper extends MyMapper<SettleDetail> {

    Integer batchInsert(@Param("list") List<SettleDetail> list);

    /**
     * 根据employeeId计算本导购当月的总服务费
     *
     * @param employeeId
     * @return
     */
    BigDecimal sumAmountCharge(@Param("employeeId") Integer employeeId);

    @Select(value = "select * from t_settle_detail t where t.settle_id = #{settleId}")
    List<SettleDetail> findBySettleId(@Param("settleId") Integer settleId);

    List<SettleDetailVo> findVoBySettleId(@Param("settleId") Integer settleId);

}
